package com.oig.sys.file.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.oig.common.validator.GroupAdd;
import com.oig.common.validator.GroupEdit;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Schema
@Data
public class TemplateFileDto {

    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "参数错误,id不能为空", groups= GroupEdit.class)
    private Integer id;

//    @Schema(description = "应用id")
//    @NotNull(message = "参数错误,应用id不能为空", groups= {GroupAdd.class, GroupEdit.class})
//    private Integer systemId;
//
//    @Schema(description = "应用名称")
//    @NotEmpty(message = "参数错误,应用名称不能为空", groups= {GroupAdd.class, GroupEdit.class})
//    private String systemName;

    @Schema(description = "主业务类型,对应枚举 BusinessType 01-代理 02-仓储 03-运输", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误,业务类型不能为空", groups= {GroupAdd.class, GroupEdit.class})
    private String businessType;

    @Schema(description = "具体子单据类型,对应枚举 RelationType", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误,具体子单据类型不能为空", groups= {GroupAdd.class, GroupEdit.class})
    private String relationType;

    @Schema(description = "模板名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误,模板名称不能为空", groups= {GroupAdd.class, GroupEdit.class})
	private String templateName;

    @Schema(description = "模板文件类型")
	private String fileType;
    @Schema(description = "模板文件id")
	private String fileId;
    @Schema(description = "模板文件名称")
	private String fileName;
    @Schema(description = "模板文件url地址")
	private String fileUrl;
    @Schema(description = "备注")
	private String remark;

    @Schema(description = "所属租户id")
    @NotNull(message = "参数错误,所属租户id不能为空", groups= {GroupAdd.class, GroupEdit.class})
    private Integer tenantId;
    @Schema(description = "所属租户名称")
    @NotEmpty(message = "参数错误,所属租户不能为空", groups= {GroupAdd.class, GroupEdit.class})
    private String tenantName;

    @Schema(description = "文件上传人id")
    private Integer fileUploadId;
    @Schema(description = "文件上传人")
    private String fileUploadName;
    @Schema(description = "文件上传时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date fileUploadTime;

    @Schema(description = "复核人id")
    private Integer checkId;
    @Schema(description = "复核人")
    private String checkName;
    @Schema(description = "复核时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date checkTime;
    @Schema(description = "复核备注")
    private String checkRemark;

    @Schema(description = "0-保存，1-提交审核 默认保存")
    private String reqType;

}
